package br.com.principal;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Stack;

import br.com.objetos.Sentido;

public class Main {

	public static void main(String[] args) throws IOException {

		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));  

		FachadaPacMan fachada = new FachadaPacMan();
		String texto="";
		System.out.println(fachada.limpaTela());
		System.out.println(fachada.MostarMatriz());
		while (!texto.equalsIgnoreCase("P")) {

			System.out.println("W - Cima| S - Baixo| A - Esquerda| D - Direita || P - Parar");

			texto = buf.readLine();
			System.out.println(fachada.movimento(texto));
			System.out.println(fachada.MostarMatriz());

		}

		/**
		while (!texto.equalsIgnoreCase("P")) {
			System.out.println(engine.mostra());
			System.out.println("W - Cima| S - Baixo| A - Esquerda| D - Direita || P - Parar");
			texto = buf.readLine();

			if(texto.equalsIgnoreCase("C")){
				//engine.movePacMan(Sentido.C);
				engine.moveFantasmas();
				if(engine.fimDeJogo()){
					Limpa();
					System.out.println("Game over");
					System.out.println("Score :"+engine.getPacMan().getScore());
					return;
				}
				Limpa();
			}else if (texto.equalsIgnoreCase("W")){
				engine.movePacMan(Sentido.W);
				engine.moveFantasmas();
				if(engine.fimDeJogo()){
					Limpa();
					System.out.println("Game over");
					System.out.println("Score :"+engine.getPacMan().getScore());
					return;
				}

				Limpa();
			}else if (texto.equalsIgnoreCase("S")){
				engine.movePacMan(Sentido.S);
				engine.moveFantasmas();
				if(engine.fimDeJogo()){
					Limpa();
					System.out.println("Game over");
					System.out.println("Score :"+engine.getPacMan().getScore());
					return;

				}
				Limpa();
			}else if (texto.equalsIgnoreCase("A")){
				engine.movePacMan(Sentido.A);
				engine.moveFantasmas();
				if(engine.fimDeJogo()){
					Limpa();
					System.out.println("Game over");
					System.out.println("Score :"+engine.getPacMan().getScore());
					return;
				}
				Limpa();
			}else if (texto.equalsIgnoreCase("D")){
				engine.movePacMan(Sentido.D);
				engine.moveFantasmas();
				if(engine.fimDeJogo()){
					Limpa();
					System.out.println("Game over");
					System.out.println("Score :"+engine.getPacMan().getScore());
					return;
				}
				Limpa();
			}else if (texto.equalsIgnoreCase("P")){
				Limpa();
				System.out.println(engine.getPacMan().toString());
			}else{
				Limpa();
			}
		}

	}

		 **/




	}

}
